<div class="frame_addfactoryDiv">
  <form name="accountForm" id="accountForm"  action="administrator-paypal-dopay" method="post">
  <table width="100%" border="1" cellpadding="0" cellspacing="0" bordercolor="#c8d9e9">
    <tr>
      <td width="20%" class="ri-bbgg"> 买家用户名：</td>
      <td width="80%" class="le">
	  	<?=$this->memberArray[0]['username']?>
	  </td>
    </tr>
	<tr>
      <td width="20%" class="ri-bbgg"> 买家paypal账户：</td>
      <td width="80%" class="le">
	  	<?=$this->memberArray[0]['paypal']?>
	  </td>
    </tr>
	<tr>
      <td width="20%" class="ri-bbgg"> 买家要求退款订单：</td>
      <td width="80%" class="le">
	  	<a href="administrator-order-more?orderid=<?=$this->orderidArray[0]?>">查看订单 (订单号:J<?=$this->orderidArray[0]?>)</a>
	  </td>
    </tr>
	<tr>
      <td width="20%" class="ri-bbgg"> 应退款金额：</td>
      <td width="80%" class="le">
	  	$<?=$this->shouldReturn?>
	  </td>
    </tr>
	<tr>
      <td width="20%" class="ri-bbgg"> 要求退款方式：</td>
      <td width="80%" class="le">
	  	<?=$this->accountArray[0]['payment']?>
	  </td>
    </tr>
	<tr>
      <td width="20%" class="ri-bbgg"> 要求时间：</td>
      <td width="80%" class="le">
	  	<?=date('Y-m-d H:i:s',$this->accountArray[0]['add_time'])?>
	  </td>
    </tr>
	<tr>
	  <td width="20%" class="ri-bbgg"> 备注：</td>
	  <td width="80%" class="le">
		<?=$this->accountArray[0]['remark']?>
	  </td>
	</tr>
	<?if($this->accountArray[0]['state']=='1'):?>
		<tr>
		  <td width="20%" class="ri-bbgg"> 要求退款方式：</td>
		  <td width="80%" class="le">
			<?=$this->getPayment($this->accountArray[0]['payment'])?>
		  </td>
		</tr>
		<tr>
		  <td colspan="2" class="se" align="center">
			已经进行过退款了!
		  </td>
		</tr>
	<?else:?>
		<tr>
		  <td width="20%" class="ri-bbgg"> CDS确认退款金额：</td>
		  <td width="80%" class="le">
			<input type="text" value="" name="confirmAccount" />
		  </td>
		</tr>
		<tr>
		  <td width="20%" class="ri-bbgg"> 退款方式：</td>
		  <td width="80%" class="le">
			<input type="radio" name="payment" value="coupon" />消费券方式
			<input type="radio" name="payment" value="paypal" />Paypal方式
		  </td>
		</tr>
		<tr>
		  <td width="20%" class="ri-bbgg"> 备注：</td>
		  <td width="80%" class="le">
			<textarea name="content" style="width:300px;height:100px"></textarea>
		  </td>
		</tr>
		<tr>
		  <td colspan="2" class="se" align="center">
			<input name="accountid" type="hidden" class="iput" value="<?=$this->accountArray[0]['accountid']?>"  />
			<input type="button" class="iput" value="确认退款" onclick="confirmGive();" />
			<input type="button" class="iput" value="取消退款" onclick="cancelGive();" />
			<input type="button" class="iput" value="返 回" onclick="commonEffection.confirmBack();" />
			<a href="https://www.paypal.com/cgi-bin/webscr?cmd=_send-money&nav=0.1.0" target="_blank">进入paypal支付页面</a>
		  </td>
		</tr>
	<?endif;?>
  </table>
  </form>
</div>
<script>
function confirmGive(){
	if(!checkDecimal($('input[name="confirmAccount"]').val())){
		alert('请确认您要输入的退款金额!');
		return false;
	}
	if($($('input[name="payment"]').get(0)).attr('checked')!=true&&$($('input[name="payment"]').get(1)).attr('checked')!=true){
		alert('请选择退款方式!');
		return false;
	}
	if(confirm('再次确定退款?')){
		$('#accountForm').submit();
	}
}
function cancelGive(){
	if(!confirm('再次确认取消退款?')){
		return false;
	}
	$('#accountForm').attr('action','administrator-paypal-cancel');
	$('#accountForm').submit();
	return true;
}
</script>